package cn.hellochaos.generator.service;

import cn.hellochaos.generator.entity.CaipuList;
import cn.hellochaos.generator.entity.User;
import cn.hellochaos.generator.entity.UserCookbook;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

import java.util.List;

/**
* <p>
*  服务类
* </p>
*
* @author test
* @since 2021-01-23
*/
public interface UserCookbookService {

    /**
    * 分页查询UserCookbook
    *
    * @param page     当前页数
    * @param pageSize 页的大小
    * @param factor  搜索关键词
    * @return 返回mybatis-plus的Page对象,其中records字段为符合条件的查询结果
    * @author test
    * @since 2021-01-23
    */
    Page<UserCookbook> listUserCookbooksByPage(int page, int pageSize, String factor);

    /**
    * 根据id查询UserCookbook
    *
    * @param id 需要查询的UserCookbook的id
    * @return 返回对应id的UserCookbook对象
    * @author test
    * @since 2021-01-23
    */
    UserCookbook getUserCookbookById(int id);

    /**
    * 插入UserCookbook
    *
    * @param userCookbook 需要插入的UserCookbook对象
    * @return 返回插入成功之后UserCookbook对象的id
    * @author test
    * @since 2021-01-23
    */
    int insertUserCookbook(UserCookbook userCookbook);

    /**
    * 根据id删除UserCookbook
    *
    * @param id 需要删除的UserCookbook对象的id
    * @return 返回被删除的UserCookbook对象的id
    * @author test
    * @since 2021-01-23
    */
    int deleteUserCookbookById(int id);

    /**
    * 根据id更新UserCookbook
    *
    * @param userCookbook 需要更新的UserCookbook对象
    * @return 返回被更新的UserCookbook对象的id
    * @author test
    * @since 2021-01-23
    */
    int updateUserCookbook(UserCookbook userCookbook);

    UserCookbook favorite(String uid,String cid);

    Boolean isFavorite(String uid,String cid);

    List<CaipuList> getUserAllFavorite(User user);
}
